package forceCast;

/**
 * @Author forsake
 * @Description //TODO 
 * @Date 9:44 2021/8/9
 **/
//// 不会继承父类的toString方法
//@Data
//// 不会继承父类的构造方法
//@AllArgsConstructor
//@NoArgsConstructor

public class Son  extends Father{
    private int tall;

    public int getTall() {
        return tall;
    }

    public void setTall(int tall) {
        this.tall = tall;
    }

    public Son(int age, String name, int tall) {
        super(age, name);
        this.tall = tall;
    }

    public Son(int tall) {
        this.tall = tall;
    }

    @Override
    public String toString() {
        // private类型只有在相同类中可以访问
        return "Son{" +
                "tall=" + tall +
                "age=" + this.getAge() +
                "name=" + this.getName() +
                '}';
    }
}
